/* GUI CONVERTED from rcsdpnta.p (converter v1.76) Sun Feb 24 20:08:35 2002 */
/* rcsdpnta.p - Customer Schedules - Determines SDP and divides quantity      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.4.1.3 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3    LAST MODIFIED: 01/05/93       BY: WUG *G462*              */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98       BY: *K1Q4* Alfred Tan       */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00       BY: *N0KP* Mark Brown       */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.4.1.2   BY: Jean Miller           DATE: 12/10/01  ECO: *P03H*  */
/* $Revision: 1.4.1.3 $  BY: Anitha Gopal          DATE: 02/17/02  ECO: *N19G*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* INTERPRETS SHIP/DELIVERY PATTERN CODE SUBROUTINE */
/* DIVIDES A QUANTITY WITH RUNNING ROUND */
/* INCOMING QUANTITY EXPECTED TO BE A WHOLE NUMBER */

/* INPUT PARAMETERS: */
define shared variable req_qty as decimal.
define shared variable resch_ct as integer.

define shared variable resch_qty as decimal extent 999 no-undo.

define variable work_sum as decimal.
define variable day_qty as decimal.
define variable mod_qty as decimal.
define variable i as integer.

assign
   day_qty = truncate(req_qty / resch_ct, 0)
   mod_qty = req_qty modulo resch_ct.

do i = 1 to resch_ct:
   resch_qty[i] = day_qty.
   if i <= mod_qty then resch_qty[i] = resch_qty[i] + 1.
end.
